<template>
	<view>
		<view v-if="movie">
			<video :src="movie.videourl" controls></video>
			<view class="detail-info">
				<view class="name">{{ movie.nm }}</view>
				<view class="cat">类别：{{ movie.cat }}</view>
				<view class="dir">导演：{{ movie.dir }}</view>
				<view class="msg">{{ movie.videoName }}</view>
				<view class="act">演员：{{ movie.desc }}</view>
				<view class="showtime">上映时间：{{ movie.pubDesc }}</view>
				<view class="info2">
					<view class="sc">评分：{{ movie.sc }}</view>
					<view class="wish">{{ movie.wish }}人想看</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		onMounted
	} from 'vue';

	const movie = ref({});

	onMounted(() => {
		const options = uni.getLaunchOptionsSync(); // 获取启动参数
		const movieParam = options.query.movie; // 注意这里的变化
		if (movieParam) {
			movie.value = JSON.parse(decodeURIComponent(movieParam));
		}
	});
</script>

<style scoped>
	.detail-poster {
		width: 100%;
		height: 300px;
		border-radius: 10px;
	}

	.detail-info {
		padding: 20px;
	}

	.name {
		font-size: 24px;
		font-weight: bold;
		margin-bottom: 10px;
	}

	/* 其他样式根据需要添加 */
</style>